-- GENERATED SPELL FOR [Twilight Stonecaller] --


function spell0_11882(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(9053,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11882', 3000, 1)
end

function spell1_11882(pUnit, Event) --@Petrify,n/a--
pUnit:FullCastSpellOnTarget(11020,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11882', 8293, 1)
end

function spell2_11882(pUnit, Event) --@Summon Earth Elemental,Self--
pUnit:FullCastSpellOnTarget(19704,pUnit)
pUnit:RegisterEvent('Sorts_11882', 571, 1)
end

function Sorts_11882(pUnit, Event)
local choix_sorts_11882 = math.random(0, 2)
if choix_sorts_11882 == 0 then
pUnit:RegisterEvent('spell0_11882', 1, 1)
end
if choix_sorts_11882 == 1 then
pUnit:RegisterEvent('spell1_11882', 1, 1)
end
if choix_sorts_11882 == 2 then
pUnit:RegisterEvent('spell2_11882', 1, 1)
end
end

function mob11882_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11882', math.random(1500, 3000), 1)
end

function mob11882_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11882_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11882_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11882, 1, 'mob11882_Action')
RegisterUnitEvent(11882, 2, 'mob11882_Leave')
RegisterUnitEvent(11882, 3, 'mob11882_Kill')
RegisterUnitEvent(11882, 4, 'mob11882_Die')
